#include "PAP_defs.h"
#include "derivative.h"


#define IIC_BAUDRATE_100KBPS 0x47 //    FALTA DEFINIR
#define IIC_MODE_MASTER 1
#define IIC_MODE_SLAVE 0
#define IIC_TRANSMIT 1
#define IIC_RECEIVE 0
#define IIC_MODULE_1 1
#define IIC_MODULE_2 2
#define IIC_INTERRUPTS_ENABLED 1
#define IIC_INTERRUPTS_DISABLED 0
#define IIC_MODULE_ENABLED 1
#define IIC_MODULE_DISABLED 0
#define IIC_TX_ACK_ENABLED 0
#define IIC_TX_ACK_DISABLED 1
#define IIC_ADDRESS_MODE_7BITS 0
#define IIC_ADDRESS_MODE_10BITS 1
#define IIC_CALL_ADDRESS_ENABLED 1
#define IIC_CALL_ADDRESS_DISABLED 0


void vfnIIC_SetAddress (uint8 u8module, uint8 u8address); 

void vfnIIC_BaudRate (uint8 u8module, uint8 u8rate);

void vfnIIC_ModuleStatus (uint8 u8module, uint8 u8status);

void vfnIIC_InterruptStatus (uint8 u8module,uint8 u8status);

void vfnIIC_ModeSelect (uint8 u8module, uint8 u8mode);

void vfnIIC_DataDirection (uint8 u8module, uint8 u8dir);

void vfnIIC_TxAcknowledgeStatus (uint8 u8module, uint8 u8status);

void vfnIIC_Restart (uint8 u8module);

uint8 u8IIC_TransferComplete (uint8 u8module);

uint8 u8IIC_CheckIfAdressed (uint8 u8module);

uint8 u8IIC_BusBusy (uint8 u8module);

uint8 u8IIC_ArbitrationLost (uint8 u8module);

uint8 u8IIC_SlaveStatus (uint8 u8module);

uint8 u8IIC_CheckInterrupt (uint8 u8module);

uint8 u8IIC_AckReceived (uint8 u8module);

void vfnIIC_SendData (uint8 u8module, uint8 u8data);

uint8 u8IIC_ReadData (uint8 u8module);

void vfnIIC_CallAddressStatus (uint8 u8module, uint8 u8status);

void vfnIIC_AddressMode (uint8 u8module,uint8 u8mode);

void vfnIIC_ClearInterruptFlag (uint8 u8module);

uint8 u8IIC_MasterMode (uint8 u8module);

uint8 u8IIC_TransmitMode (uint8 u8module);

uint8 u8IIC_ClearArbitrationLost (uint8 u8module);
